package net.ifilm.dao;

import com.ibatis.sqlmap.client.SqlMapClient;
import net.ifilm.entity.FilmDiscuss;
import net.ifilm.entity.FilmPath;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <code>FilmPathDao</code>类主要对于电影网络路径的数据库操作
 *
 * @author wangjunneil@gmail.com
 */
@Repository
public class FilmPathDao extends SqlMapClientDaoSupport {
    
    @Autowired
    public void setSqlMapClientOverride(SqlMapClient sqlMapClient) {
        super.setSqlMapClient(sqlMapClient);
    }

    // ---------------------------------------------------------------------------------------- business method

    /**
     * 关联电影与电影路径的关系
     *
     * @param filmPath 电影路径关系表
     */
    public void relfilmpath(FilmPath filmPath) {
        getSqlMapClientTemplate().insert("relfilmpath", filmPath);
    }

    /**
     * 根据电影ID删除电影网络路径条目
     */
    public void delFilmPath(int filmId) {
        getSqlMapClientTemplate().insert("delFilmPathById", filmId);
    }

    
} // /:~
